﻿using System.IO;
using System.Text;
using System.Xml.Serialization;
using NUnit.Framework;

namespace Tests.ModelTests
{
    public class SerializationTestBase<T>
    {
        protected T DeSerialise(string resourceName)
        {
            var serializer = new XmlSerializer(typeof(T));

            var stream = new MemoryStream(Encoding.ASCII.GetBytes(Files.ResourceManager.GetString(resourceName)));
            return (T)serializer.Deserialize(stream);
        }
    }
}
